package task3;

public class AnimalDemo {
	public static void main(String[] args) {
		Animal d1 = new Dog("panterata", "gosho", 4);
		Zoo z1 = new Zoo();
		z1.addAnimal(d1);
		Animal c2 = new Cat("kotka", "desi", 3);
		z1.addAnimal(c2);
		Bird b1 = new Bird("lqstovichka" , "koko", 9);
		z1.addAnimal(b1);
		for(Animal a: z1.getAnimals()){
			if(a!=null){
				System.out.println(a.getAnimal());
				System.out.println(a.getName());
				System.out.println(a.getAge());
				if(a instanceof Bird){
					b1.fly();
				}
				a.walk();
				System.out.println();
			}
		}
	}
}
